package com.balloon.springboot.datasource;


import com.balloon.springboot.datasource.datasourceholder.DataSourceContextHolder;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * 多数据源路由选择器
 *
 * @author liaofuxing
 * @data 2021/9/18
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
        return DataSourceContextHolder.getDataSourceHolder();
    }
}